using System;
using System.Collections;
using System.Runtime.InteropServices;
using System.Runtime.InteropServices.ComTypes;
using System.Threading;
namespace SHDocVw
{
	internal sealed class DWebBrowserEvents_EventProvider : DWebBrowserEvents_Event, IDisposable
	{
		private IConnectionPointContainer m_ConnectionPointContainer;
		private ArrayList m_aEventSinkHelpers;
		private IConnectionPoint m_ConnectionPoint;
		private void Init()
		{
			IConnectionPoint connectionPoint = null;
			Guid guid = new Guid(new byte[]
			{
				194,
				42,
				178,
				234,
				193,
				48,
				207,
				17,
				167,
				235,
				0,
				0,
				192,
				91,
				174,
				11
			});
			this.m_ConnectionPointContainer.FindConnectionPoint(ref guid, out connectionPoint);
			this.m_ConnectionPoint = (IConnectionPoint)connectionPoint;
			this.m_aEventSinkHelpers = new ArrayList();
		}
		public override void add_BeforeNavigate(DWebBrowserEvents_BeforeNavigateEventHandler beforeNavigateDelegate)
		{
			Monitor.Enter(this);
			try
			{
				if (this.m_ConnectionPoint == null)
				{
					this.Init();
				}
				DWebBrowserEvents_SinkHelper dWebBrowserEvents_SinkHelper = new DWebBrowserEvents_SinkHelper();
				int dwCookie = 0;
				this.m_ConnectionPoint.Advise((object)dWebBrowserEvents_SinkHelper, out dwCookie);
				dWebBrowserEvents_SinkHelper.m_dwCookie = dwCookie;
				dWebBrowserEvents_SinkHelper.m_BeforeNavigateDelegate = beforeNavigateDelegate;
				this.m_aEventSinkHelpers.Add((object)dWebBrowserEvents_SinkHelper);
			}
			finally
			{
				Monitor.Exit(this);
			}
		}
		public override void remove_BeforeNavigate(DWebBrowserEvents_BeforeNavigateEventHandler dWebBrowserEvents_BeforeNavigateEventHandler)
		{
			Monitor.Enter(this);
			try
			{
				if (this.m_aEventSinkHelpers != null)
				{
					int count = this.m_aEventSinkHelpers.Count;
					int num = 0;
					if (0 < count)
					{
						DWebBrowserEvents_SinkHelper dWebBrowserEvents_SinkHelper;
						while (true)
						{
							dWebBrowserEvents_SinkHelper = (DWebBrowserEvents_SinkHelper)this.m_aEventSinkHelpers[num];
							if (dWebBrowserEvents_SinkHelper.m_BeforeNavigateDelegate != null && ((dWebBrowserEvents_SinkHelper.m_BeforeNavigateDelegate.Equals((object)dWebBrowserEvents_BeforeNavigateEventHandler) ? 1 : 0) & 255) != 0)
							{
								break;
							}
							num++;
							if (num >= count)
							{
								goto IL_E1;
							}
						}
						this.m_aEventSinkHelpers.RemoveAt(num);
						this.m_ConnectionPoint.Unadvise(dWebBrowserEvents_SinkHelper.m_dwCookie);
						if (count <= 1)
						{
							Marshal.ReleaseComObject(this.m_ConnectionPoint);
							this.m_ConnectionPoint = null;
							this.m_aEventSinkHelpers = null;
						}
					}
				}
				IL_E1:;
			}
			finally
			{
				Monitor.Exit(this);
			}
		}
		public override void add_NavigateComplete(DWebBrowserEvents_NavigateCompleteEventHandler navigateCompleteDelegate)
		{
			Monitor.Enter(this);
			try
			{
				if (this.m_ConnectionPoint == null)
				{
					this.Init();
				}
				DWebBrowserEvents_SinkHelper dWebBrowserEvents_SinkHelper = new DWebBrowserEvents_SinkHelper();
				int dwCookie = 0;
				this.m_ConnectionPoint.Advise((object)dWebBrowserEvents_SinkHelper, out dwCookie);
				dWebBrowserEvents_SinkHelper.m_dwCookie = dwCookie;
				dWebBrowserEvents_SinkHelper.m_NavigateCompleteDelegate = navigateCompleteDelegate;
				this.m_aEventSinkHelpers.Add((object)dWebBrowserEvents_SinkHelper);
			}
			finally
			{
				Monitor.Exit(this);
			}
		}
		public override void remove_NavigateComplete(DWebBrowserEvents_NavigateCompleteEventHandler dWebBrowserEvents_NavigateCompleteEventHandler)
		{
			Monitor.Enter(this);
			try
			{
				if (this.m_aEventSinkHelpers != null)
				{
					int count = this.m_aEventSinkHelpers.Count;
					int num = 0;
					if (0 < count)
					{
						DWebBrowserEvents_SinkHelper dWebBrowserEvents_SinkHelper;
						while (true)
						{
							dWebBrowserEvents_SinkHelper = (DWebBrowserEvents_SinkHelper)this.m_aEventSinkHelpers[num];
							if (dWebBrowserEvents_SinkHelper.m_NavigateCompleteDelegate != null && ((dWebBrowserEvents_SinkHelper.m_NavigateCompleteDelegate.Equals((object)dWebBrowserEvents_NavigateCompleteEventHandler) ? 1 : 0) & 255) != 0)
							{
								break;
							}
							num++;
							if (num >= count)
							{
								goto IL_E1;
							}
						}
						this.m_aEventSinkHelpers.RemoveAt(num);
						this.m_ConnectionPoint.Unadvise(dWebBrowserEvents_SinkHelper.m_dwCookie);
						if (count <= 1)
						{
							Marshal.ReleaseComObject(this.m_ConnectionPoint);
							this.m_ConnectionPoint = null;
							this.m_aEventSinkHelpers = null;
						}
					}
				}
				IL_E1:;
			}
			finally
			{
				Monitor.Exit(this);
			}
		}
		public override void add_StatusTextChange(DWebBrowserEvents_StatusTextChangeEventHandler statusTextChangeDelegate)
		{
			Monitor.Enter(this);
			try
			{
				if (this.m_ConnectionPoint == null)
				{
					this.Init();
				}
				DWebBrowserEvents_SinkHelper dWebBrowserEvents_SinkHelper = new DWebBrowserEvents_SinkHelper();
				int dwCookie = 0;
				this.m_ConnectionPoint.Advise((object)dWebBrowserEvents_SinkHelper, out dwCookie);
				dWebBrowserEvents_SinkHelper.m_dwCookie = dwCookie;
				dWebBrowserEvents_SinkHelper.m_StatusTextChangeDelegate = statusTextChangeDelegate;
				this.m_aEventSinkHelpers.Add((object)dWebBrowserEvents_SinkHelper);
			}
			finally
			{
				Monitor.Exit(this);
			}
		}
		public override void remove_StatusTextChange(DWebBrowserEvents_StatusTextChangeEventHandler dWebBrowserEvents_StatusTextChangeEventHandler)
		{
			Monitor.Enter(this);
			try
			{
				if (this.m_aEventSinkHelpers != null)
				{
					int count = this.m_aEventSinkHelpers.Count;
					int num = 0;
					if (0 < count)
					{
						DWebBrowserEvents_SinkHelper dWebBrowserEvents_SinkHelper;
						while (true)
						{
							dWebBrowserEvents_SinkHelper = (DWebBrowserEvents_SinkHelper)this.m_aEventSinkHelpers[num];
							if (dWebBrowserEvents_SinkHelper.m_StatusTextChangeDelegate != null && ((dWebBrowserEvents_SinkHelper.m_StatusTextChangeDelegate.Equals((object)dWebBrowserEvents_StatusTextChangeEventHandler) ? 1 : 0) & 255) != 0)
							{
								break;
							}
							num++;
							if (num >= count)
							{
								goto IL_E1;
							}
						}
						this.m_aEventSinkHelpers.RemoveAt(num);
						this.m_ConnectionPoint.Unadvise(dWebBrowserEvents_SinkHelper.m_dwCookie);
						if (count <= 1)
						{
							Marshal.ReleaseComObject(this.m_ConnectionPoint);
							this.m_ConnectionPoint = null;
							this.m_aEventSinkHelpers = null;
						}
					}
				}
				IL_E1:;
			}
			finally
			{
				Monitor.Exit(this);
			}
		}
		public override void add_ProgressChange(DWebBrowserEvents_ProgressChangeEventHandler progressChangeDelegate)
		{
			Monitor.Enter(this);
			try
			{
				if (this.m_ConnectionPoint == null)
				{
					this.Init();
				}
				DWebBrowserEvents_SinkHelper dWebBrowserEvents_SinkHelper = new DWebBrowserEvents_SinkHelper();
				int dwCookie = 0;
				this.m_ConnectionPoint.Advise((object)dWebBrowserEvents_SinkHelper, out dwCookie);
				dWebBrowserEvents_SinkHelper.m_dwCookie = dwCookie;
				dWebBrowserEvents_SinkHelper.m_ProgressChangeDelegate = progressChangeDelegate;
				this.m_aEventSinkHelpers.Add((object)dWebBrowserEvents_SinkHelper);
			}
			finally
			{
				Monitor.Exit(this);
			}
		}
		public override void remove_ProgressChange(DWebBrowserEvents_ProgressChangeEventHandler dWebBrowserEvents_ProgressChangeEventHandler)
		{
			Monitor.Enter(this);
			try
			{
				if (this.m_aEventSinkHelpers != null)
				{
					int count = this.m_aEventSinkHelpers.Count;
					int num = 0;
					if (0 < count)
					{
						DWebBrowserEvents_SinkHelper dWebBrowserEvents_SinkHelper;
						while (true)
						{
							dWebBrowserEvents_SinkHelper = (DWebBrowserEvents_SinkHelper)this.m_aEventSinkHelpers[num];
							if (dWebBrowserEvents_SinkHelper.m_ProgressChangeDelegate != null && ((dWebBrowserEvents_SinkHelper.m_ProgressChangeDelegate.Equals((object)dWebBrowserEvents_ProgressChangeEventHandler) ? 1 : 0) & 255) != 0)
							{
								break;
							}
							num++;
							if (num >= count)
							{
								goto IL_E1;
							}
						}
						this.m_aEventSinkHelpers.RemoveAt(num);
						this.m_ConnectionPoint.Unadvise(dWebBrowserEvents_SinkHelper.m_dwCookie);
						if (count <= 1)
						{
							Marshal.ReleaseComObject(this.m_ConnectionPoint);
							this.m_ConnectionPoint = null;
							this.m_aEventSinkHelpers = null;
						}
					}
				}
				IL_E1:;
			}
			finally
			{
				Monitor.Exit(this);
			}
		}
		public override void add_DownloadComplete(DWebBrowserEvents_DownloadCompleteEventHandler downloadCompleteDelegate)
		{
			Monitor.Enter(this);
			try
			{
				if (this.m_ConnectionPoint == null)
				{
					this.Init();
				}
				DWebBrowserEvents_SinkHelper dWebBrowserEvents_SinkHelper = new DWebBrowserEvents_SinkHelper();
				int dwCookie = 0;
				this.m_ConnectionPoint.Advise((object)dWebBrowserEvents_SinkHelper, out dwCookie);
				dWebBrowserEvents_SinkHelper.m_dwCookie = dwCookie;
				dWebBrowserEvents_SinkHelper.m_DownloadCompleteDelegate = downloadCompleteDelegate;
				this.m_aEventSinkHelpers.Add((object)dWebBrowserEvents_SinkHelper);
			}
			finally
			{
				Monitor.Exit(this);
			}
		}
		public override void remove_DownloadComplete(DWebBrowserEvents_DownloadCompleteEventHandler dWebBrowserEvents_DownloadCompleteEventHandler)
		{
			Monitor.Enter(this);
			try
			{
				if (this.m_aEventSinkHelpers != null)
				{
					int count = this.m_aEventSinkHelpers.Count;
					int num = 0;
					if (0 < count)
					{
						DWebBrowserEvents_SinkHelper dWebBrowserEvents_SinkHelper;
						while (true)
						{
							dWebBrowserEvents_SinkHelper = (DWebBrowserEvents_SinkHelper)this.m_aEventSinkHelpers[num];
							if (dWebBrowserEvents_SinkHelper.m_DownloadCompleteDelegate != null && ((dWebBrowserEvents_SinkHelper.m_DownloadCompleteDelegate.Equals((object)dWebBrowserEvents_DownloadCompleteEventHandler) ? 1 : 0) & 255) != 0)
							{
								break;
							}
							num++;
							if (num >= count)
							{
								goto IL_E1;
							}
						}
						this.m_aEventSinkHelpers.RemoveAt(num);
						this.m_ConnectionPoint.Unadvise(dWebBrowserEvents_SinkHelper.m_dwCookie);
						if (count <= 1)
						{
							Marshal.ReleaseComObject(this.m_ConnectionPoint);
							this.m_ConnectionPoint = null;
							this.m_aEventSinkHelpers = null;
						}
					}
				}
				IL_E1:;
			}
			finally
			{
				Monitor.Exit(this);
			}
		}
		public override void add_CommandStateChange(DWebBrowserEvents_CommandStateChangeEventHandler commandStateChangeDelegate)
		{
			Monitor.Enter(this);
			try
			{
				if (this.m_ConnectionPoint == null)
				{
					this.Init();
				}
				DWebBrowserEvents_SinkHelper dWebBrowserEvents_SinkHelper = new DWebBrowserEvents_SinkHelper();
				int dwCookie = 0;
				this.m_ConnectionPoint.Advise((object)dWebBrowserEvents_SinkHelper, out dwCookie);
				dWebBrowserEvents_SinkHelper.m_dwCookie = dwCookie;
				dWebBrowserEvents_SinkHelper.m_CommandStateChangeDelegate = commandStateChangeDelegate;
				this.m_aEventSinkHelpers.Add((object)dWebBrowserEvents_SinkHelper);
			}
			finally
			{
				Monitor.Exit(this);
			}
		}
		public override void remove_CommandStateChange(DWebBrowserEvents_CommandStateChangeEventHandler dWebBrowserEvents_CommandStateChangeEventHandler)
		{
			Monitor.Enter(this);
			try
			{
				if (this.m_aEventSinkHelpers != null)
				{
					int count = this.m_aEventSinkHelpers.Count;
					int num = 0;
					if (0 < count)
					{
						DWebBrowserEvents_SinkHelper dWebBrowserEvents_SinkHelper;
						while (true)
						{
							dWebBrowserEvents_SinkHelper = (DWebBrowserEvents_SinkHelper)this.m_aEventSinkHelpers[num];
							if (dWebBrowserEvents_SinkHelper.m_CommandStateChangeDelegate != null && ((dWebBrowserEvents_SinkHelper.m_CommandStateChangeDelegate.Equals((object)dWebBrowserEvents_CommandStateChangeEventHandler) ? 1 : 0) & 255) != 0)
							{
								break;
							}
							num++;
							if (num >= count)
							{
								goto IL_E1;
							}
						}
						this.m_aEventSinkHelpers.RemoveAt(num);
						this.m_ConnectionPoint.Unadvise(dWebBrowserEvents_SinkHelper.m_dwCookie);
						if (count <= 1)
						{
							Marshal.ReleaseComObject(this.m_ConnectionPoint);
							this.m_ConnectionPoint = null;
							this.m_aEventSinkHelpers = null;
						}
					}
				}
				IL_E1:;
			}
			finally
			{
				Monitor.Exit(this);
			}
		}
		public override void add_DownloadBegin(DWebBrowserEvents_DownloadBeginEventHandler downloadBeginDelegate)
		{
			Monitor.Enter(this);
			try
			{
				if (this.m_ConnectionPoint == null)
				{
					this.Init();
				}
				DWebBrowserEvents_SinkHelper dWebBrowserEvents_SinkHelper = new DWebBrowserEvents_SinkHelper();
				int dwCookie = 0;
				this.m_ConnectionPoint.Advise((object)dWebBrowserEvents_SinkHelper, out dwCookie);
				dWebBrowserEvents_SinkHelper.m_dwCookie = dwCookie;
				dWebBrowserEvents_SinkHelper.m_DownloadBeginDelegate = downloadBeginDelegate;
				this.m_aEventSinkHelpers.Add((object)dWebBrowserEvents_SinkHelper);
			}
			finally
			{
				Monitor.Exit(this);
			}
		}
		public override void remove_DownloadBegin(DWebBrowserEvents_DownloadBeginEventHandler dWebBrowserEvents_DownloadBeginEventHandler)
		{
			Monitor.Enter(this);
			try
			{
				if (this.m_aEventSinkHelpers != null)
				{
					int count = this.m_aEventSinkHelpers.Count;
					int num = 0;
					if (0 < count)
					{
						DWebBrowserEvents_SinkHelper dWebBrowserEvents_SinkHelper;
						while (true)
						{
							dWebBrowserEvents_SinkHelper = (DWebBrowserEvents_SinkHelper)this.m_aEventSinkHelpers[num];
							if (dWebBrowserEvents_SinkHelper.m_DownloadBeginDelegate != null && ((dWebBrowserEvents_SinkHelper.m_DownloadBeginDelegate.Equals((object)dWebBrowserEvents_DownloadBeginEventHandler) ? 1 : 0) & 255) != 0)
							{
								break;
							}
							num++;
							if (num >= count)
							{
								goto IL_E1;
							}
						}
						this.m_aEventSinkHelpers.RemoveAt(num);
						this.m_ConnectionPoint.Unadvise(dWebBrowserEvents_SinkHelper.m_dwCookie);
						if (count <= 1)
						{
							Marshal.ReleaseComObject(this.m_ConnectionPoint);
							this.m_ConnectionPoint = null;
							this.m_aEventSinkHelpers = null;
						}
					}
				}
				IL_E1:;
			}
			finally
			{
				Monitor.Exit(this);
			}
		}
		public override void add_NewWindow(DWebBrowserEvents_NewWindowEventHandler newWindowDelegate)
		{
			Monitor.Enter(this);
			try
			{
				if (this.m_ConnectionPoint == null)
				{
					this.Init();
				}
				DWebBrowserEvents_SinkHelper dWebBrowserEvents_SinkHelper = new DWebBrowserEvents_SinkHelper();
				int dwCookie = 0;
				this.m_ConnectionPoint.Advise((object)dWebBrowserEvents_SinkHelper, out dwCookie);
				dWebBrowserEvents_SinkHelper.m_dwCookie = dwCookie;
				dWebBrowserEvents_SinkHelper.m_NewWindowDelegate = newWindowDelegate;
				this.m_aEventSinkHelpers.Add((object)dWebBrowserEvents_SinkHelper);
			}
			finally
			{
				Monitor.Exit(this);
			}
		}
		public override void remove_NewWindow(DWebBrowserEvents_NewWindowEventHandler dWebBrowserEvents_NewWindowEventHandler)
		{
			Monitor.Enter(this);
			try
			{
				if (this.m_aEventSinkHelpers != null)
				{
					int count = this.m_aEventSinkHelpers.Count;
					int num = 0;
					if (0 < count)
					{
						DWebBrowserEvents_SinkHelper dWebBrowserEvents_SinkHelper;
						while (true)
						{
							dWebBrowserEvents_SinkHelper = (DWebBrowserEvents_SinkHelper)this.m_aEventSinkHelpers[num];
							if (dWebBrowserEvents_SinkHelper.m_NewWindowDelegate != null && ((dWebBrowserEvents_SinkHelper.m_NewWindowDelegate.Equals((object)dWebBrowserEvents_NewWindowEventHandler) ? 1 : 0) & 255) != 0)
							{
								break;
							}
							num++;
							if (num >= count)
							{
								goto IL_E1;
							}
						}
						this.m_aEventSinkHelpers.RemoveAt(num);
						this.m_ConnectionPoint.Unadvise(dWebBrowserEvents_SinkHelper.m_dwCookie);
						if (count <= 1)
						{
							Marshal.ReleaseComObject(this.m_ConnectionPoint);
							this.m_ConnectionPoint = null;
							this.m_aEventSinkHelpers = null;
						}
					}
				}
				IL_E1:;
			}
			finally
			{
				Monitor.Exit(this);
			}
		}
		public override void add_TitleChange(DWebBrowserEvents_TitleChangeEventHandler titleChangeDelegate)
		{
			Monitor.Enter(this);
			try
			{
				if (this.m_ConnectionPoint == null)
				{
					this.Init();
				}
				DWebBrowserEvents_SinkHelper dWebBrowserEvents_SinkHelper = new DWebBrowserEvents_SinkHelper();
				int dwCookie = 0;
				this.m_ConnectionPoint.Advise((object)dWebBrowserEvents_SinkHelper, out dwCookie);
				dWebBrowserEvents_SinkHelper.m_dwCookie = dwCookie;
				dWebBrowserEvents_SinkHelper.m_TitleChangeDelegate = titleChangeDelegate;
				this.m_aEventSinkHelpers.Add((object)dWebBrowserEvents_SinkHelper);
			}
			finally
			{
				Monitor.Exit(this);
			}
		}
		public override void remove_TitleChange(DWebBrowserEvents_TitleChangeEventHandler dWebBrowserEvents_TitleChangeEventHandler)
		{
			Monitor.Enter(this);
			try
			{
				if (this.m_aEventSinkHelpers != null)
				{
					int count = this.m_aEventSinkHelpers.Count;
					int num = 0;
					if (0 < count)
					{
						DWebBrowserEvents_SinkHelper dWebBrowserEvents_SinkHelper;
						while (true)
						{
							dWebBrowserEvents_SinkHelper = (DWebBrowserEvents_SinkHelper)this.m_aEventSinkHelpers[num];
							if (dWebBrowserEvents_SinkHelper.m_TitleChangeDelegate != null && ((dWebBrowserEvents_SinkHelper.m_TitleChangeDelegate.Equals((object)dWebBrowserEvents_TitleChangeEventHandler) ? 1 : 0) & 255) != 0)
							{
								break;
							}
							num++;
							if (num >= count)
							{
								goto IL_E1;
							}
						}
						this.m_aEventSinkHelpers.RemoveAt(num);
						this.m_ConnectionPoint.Unadvise(dWebBrowserEvents_SinkHelper.m_dwCookie);
						if (count <= 1)
						{
							Marshal.ReleaseComObject(this.m_ConnectionPoint);
							this.m_ConnectionPoint = null;
							this.m_aEventSinkHelpers = null;
						}
					}
				}
				IL_E1:;
			}
			finally
			{
				Monitor.Exit(this);
			}
		}
		public override void add_FrameBeforeNavigate(DWebBrowserEvents_FrameBeforeNavigateEventHandler frameBeforeNavigateDelegate)
		{
			Monitor.Enter(this);
			try
			{
				if (this.m_ConnectionPoint == null)
				{
					this.Init();
				}
				DWebBrowserEvents_SinkHelper dWebBrowserEvents_SinkHelper = new DWebBrowserEvents_SinkHelper();
				int dwCookie = 0;
				this.m_ConnectionPoint.Advise((object)dWebBrowserEvents_SinkHelper, out dwCookie);
				dWebBrowserEvents_SinkHelper.m_dwCookie = dwCookie;
				dWebBrowserEvents_SinkHelper.m_FrameBeforeNavigateDelegate = frameBeforeNavigateDelegate;
				this.m_aEventSinkHelpers.Add((object)dWebBrowserEvents_SinkHelper);
			}
			finally
			{
				Monitor.Exit(this);
			}
		}
		public override void remove_FrameBeforeNavigate(DWebBrowserEvents_FrameBeforeNavigateEventHandler dWebBrowserEvents_FrameBeforeNavigateEventHandler)
		{
			Monitor.Enter(this);
			try
			{
				if (this.m_aEventSinkHelpers != null)
				{
					int count = this.m_aEventSinkHelpers.Count;
					int num = 0;
					if (0 < count)
					{
						DWebBrowserEvents_SinkHelper dWebBrowserEvents_SinkHelper;
						while (true)
						{
							dWebBrowserEvents_SinkHelper = (DWebBrowserEvents_SinkHelper)this.m_aEventSinkHelpers[num];
							if (dWebBrowserEvents_SinkHelper.m_FrameBeforeNavigateDelegate != null && ((dWebBrowserEvents_SinkHelper.m_FrameBeforeNavigateDelegate.Equals((object)dWebBrowserEvents_FrameBeforeNavigateEventHandler) ? 1 : 0) & 255) != 0)
							{
								break;
							}
							num++;
							if (num >= count)
							{
								goto IL_E1;
							}
						}
						this.m_aEventSinkHelpers.RemoveAt(num);
						this.m_ConnectionPoint.Unadvise(dWebBrowserEvents_SinkHelper.m_dwCookie);
						if (count <= 1)
						{
							Marshal.ReleaseComObject(this.m_ConnectionPoint);
							this.m_ConnectionPoint = null;
							this.m_aEventSinkHelpers = null;
						}
					}
				}
				IL_E1:;
			}
			finally
			{
				Monitor.Exit(this);
			}
		}
		public override void add_FrameNavigateComplete(DWebBrowserEvents_FrameNavigateCompleteEventHandler frameNavigateCompleteDelegate)
		{
			Monitor.Enter(this);
			try
			{
				if (this.m_ConnectionPoint == null)
				{
					this.Init();
				}
				DWebBrowserEvents_SinkHelper dWebBrowserEvents_SinkHelper = new DWebBrowserEvents_SinkHelper();
				int dwCookie = 0;
				this.m_ConnectionPoint.Advise((object)dWebBrowserEvents_SinkHelper, out dwCookie);
				dWebBrowserEvents_SinkHelper.m_dwCookie = dwCookie;
				dWebBrowserEvents_SinkHelper.m_FrameNavigateCompleteDelegate = frameNavigateCompleteDelegate;
				this.m_aEventSinkHelpers.Add((object)dWebBrowserEvents_SinkHelper);
			}
			finally
			{
				Monitor.Exit(this);
			}
		}
		public override void remove_FrameNavigateComplete(DWebBrowserEvents_FrameNavigateCompleteEventHandler dWebBrowserEvents_FrameNavigateCompleteEventHandler)
		{
			Monitor.Enter(this);
			try
			{
				if (this.m_aEventSinkHelpers != null)
				{
					int count = this.m_aEventSinkHelpers.Count;
					int num = 0;
					if (0 < count)
					{
						DWebBrowserEvents_SinkHelper dWebBrowserEvents_SinkHelper;
						while (true)
						{
							dWebBrowserEvents_SinkHelper = (DWebBrowserEvents_SinkHelper)this.m_aEventSinkHelpers[num];
							if (dWebBrowserEvents_SinkHelper.m_FrameNavigateCompleteDelegate != null && ((dWebBrowserEvents_SinkHelper.m_FrameNavigateCompleteDelegate.Equals((object)dWebBrowserEvents_FrameNavigateCompleteEventHandler) ? 1 : 0) & 255) != 0)
							{
								break;
							}
							num++;
							if (num >= count)
							{
								goto IL_E1;
							}
						}
						this.m_aEventSinkHelpers.RemoveAt(num);
						this.m_ConnectionPoint.Unadvise(dWebBrowserEvents_SinkHelper.m_dwCookie);
						if (count <= 1)
						{
							Marshal.ReleaseComObject(this.m_ConnectionPoint);
							this.m_ConnectionPoint = null;
							this.m_aEventSinkHelpers = null;
						}
					}
				}
				IL_E1:;
			}
			finally
			{
				Monitor.Exit(this);
			}
		}
		public override void add_FrameNewWindow(DWebBrowserEvents_FrameNewWindowEventHandler frameNewWindowDelegate)
		{
			Monitor.Enter(this);
			try
			{
				if (this.m_ConnectionPoint == null)
				{
					this.Init();
				}
				DWebBrowserEvents_SinkHelper dWebBrowserEvents_SinkHelper = new DWebBrowserEvents_SinkHelper();
				int dwCookie = 0;
				this.m_ConnectionPoint.Advise((object)dWebBrowserEvents_SinkHelper, out dwCookie);
				dWebBrowserEvents_SinkHelper.m_dwCookie = dwCookie;
				dWebBrowserEvents_SinkHelper.m_FrameNewWindowDelegate = frameNewWindowDelegate;
				this.m_aEventSinkHelpers.Add((object)dWebBrowserEvents_SinkHelper);
			}
			finally
			{
				Monitor.Exit(this);
			}
		}
		public override void remove_FrameNewWindow(DWebBrowserEvents_FrameNewWindowEventHandler dWebBrowserEvents_FrameNewWindowEventHandler)
		{
			Monitor.Enter(this);
			try
			{
				if (this.m_aEventSinkHelpers != null)
				{
					int count = this.m_aEventSinkHelpers.Count;
					int num = 0;
					if (0 < count)
					{
						DWebBrowserEvents_SinkHelper dWebBrowserEvents_SinkHelper;
						while (true)
						{
							dWebBrowserEvents_SinkHelper = (DWebBrowserEvents_SinkHelper)this.m_aEventSinkHelpers[num];
							if (dWebBrowserEvents_SinkHelper.m_FrameNewWindowDelegate != null && ((dWebBrowserEvents_SinkHelper.m_FrameNewWindowDelegate.Equals((object)dWebBrowserEvents_FrameNewWindowEventHandler) ? 1 : 0) & 255) != 0)
							{
								break;
							}
							num++;
							if (num >= count)
							{
								goto IL_E1;
							}
						}
						this.m_aEventSinkHelpers.RemoveAt(num);
						this.m_ConnectionPoint.Unadvise(dWebBrowserEvents_SinkHelper.m_dwCookie);
						if (count <= 1)
						{
							Marshal.ReleaseComObject(this.m_ConnectionPoint);
							this.m_ConnectionPoint = null;
							this.m_aEventSinkHelpers = null;
						}
					}
				}
				IL_E1:;
			}
			finally
			{
				Monitor.Exit(this);
			}
		}
		public override void add_Quit(DWebBrowserEvents_QuitEventHandler quitDelegate)
		{
			Monitor.Enter(this);
			try
			{
				if (this.m_ConnectionPoint == null)
				{
					this.Init();
				}
				DWebBrowserEvents_SinkHelper dWebBrowserEvents_SinkHelper = new DWebBrowserEvents_SinkHelper();
				int dwCookie = 0;
				this.m_ConnectionPoint.Advise((object)dWebBrowserEvents_SinkHelper, out dwCookie);
				dWebBrowserEvents_SinkHelper.m_dwCookie = dwCookie;
				dWebBrowserEvents_SinkHelper.m_QuitDelegate = quitDelegate;
				this.m_aEventSinkHelpers.Add((object)dWebBrowserEvents_SinkHelper);
			}
			finally
			{
				Monitor.Exit(this);
			}
		}
		public override void remove_Quit(DWebBrowserEvents_QuitEventHandler dWebBrowserEvents_QuitEventHandler)
		{
			Monitor.Enter(this);
			try
			{
				if (this.m_aEventSinkHelpers != null)
				{
					int count = this.m_aEventSinkHelpers.Count;
					int num = 0;
					if (0 < count)
					{
						DWebBrowserEvents_SinkHelper dWebBrowserEvents_SinkHelper;
						while (true)
						{
							dWebBrowserEvents_SinkHelper = (DWebBrowserEvents_SinkHelper)this.m_aEventSinkHelpers[num];
							if (dWebBrowserEvents_SinkHelper.m_QuitDelegate != null && ((dWebBrowserEvents_SinkHelper.m_QuitDelegate.Equals((object)dWebBrowserEvents_QuitEventHandler) ? 1 : 0) & 255) != 0)
							{
								break;
							}
							num++;
							if (num >= count)
							{
								goto IL_E1;
							}
						}
						this.m_aEventSinkHelpers.RemoveAt(num);
						this.m_ConnectionPoint.Unadvise(dWebBrowserEvents_SinkHelper.m_dwCookie);
						if (count <= 1)
						{
							Marshal.ReleaseComObject(this.m_ConnectionPoint);
							this.m_ConnectionPoint = null;
							this.m_aEventSinkHelpers = null;
						}
					}
				}
				IL_E1:;
			}
			finally
			{
				Monitor.Exit(this);
			}
		}
		public override void add_WindowMove(DWebBrowserEvents_WindowMoveEventHandler windowMoveDelegate)
		{
			Monitor.Enter(this);
			try
			{
				if (this.m_ConnectionPoint == null)
				{
					this.Init();
				}
				DWebBrowserEvents_SinkHelper dWebBrowserEvents_SinkHelper = new DWebBrowserEvents_SinkHelper();
				int dwCookie = 0;
				this.m_ConnectionPoint.Advise((object)dWebBrowserEvents_SinkHelper, out dwCookie);
				dWebBrowserEvents_SinkHelper.m_dwCookie = dwCookie;
				dWebBrowserEvents_SinkHelper.m_WindowMoveDelegate = windowMoveDelegate;
				this.m_aEventSinkHelpers.Add((object)dWebBrowserEvents_SinkHelper);
			}
			finally
			{
				Monitor.Exit(this);
			}
		}
		public override void remove_WindowMove(DWebBrowserEvents_WindowMoveEventHandler dWebBrowserEvents_WindowMoveEventHandler)
		{
			Monitor.Enter(this);
			try
			{
				if (this.m_aEventSinkHelpers != null)
				{
					int count = this.m_aEventSinkHelpers.Count;
					int num = 0;
					if (0 < count)
					{
						DWebBrowserEvents_SinkHelper dWebBrowserEvents_SinkHelper;
						while (true)
						{
							dWebBrowserEvents_SinkHelper = (DWebBrowserEvents_SinkHelper)this.m_aEventSinkHelpers[num];
							if (dWebBrowserEvents_SinkHelper.m_WindowMoveDelegate != null && ((dWebBrowserEvents_SinkHelper.m_WindowMoveDelegate.Equals((object)dWebBrowserEvents_WindowMoveEventHandler) ? 1 : 0) & 255) != 0)
							{
								break;
							}
							num++;
							if (num >= count)
							{
								goto IL_E1;
							}
						}
						this.m_aEventSinkHelpers.RemoveAt(num);
						this.m_ConnectionPoint.Unadvise(dWebBrowserEvents_SinkHelper.m_dwCookie);
						if (count <= 1)
						{
							Marshal.ReleaseComObject(this.m_ConnectionPoint);
							this.m_ConnectionPoint = null;
							this.m_aEventSinkHelpers = null;
						}
					}
				}
				IL_E1:;
			}
			finally
			{
				Monitor.Exit(this);
			}
		}
		public override void add_WindowResize(DWebBrowserEvents_WindowResizeEventHandler windowResizeDelegate)
		{
			Monitor.Enter(this);
			try
			{
				if (this.m_ConnectionPoint == null)
				{
					this.Init();
				}
				DWebBrowserEvents_SinkHelper dWebBrowserEvents_SinkHelper = new DWebBrowserEvents_SinkHelper();
				int dwCookie = 0;
				this.m_ConnectionPoint.Advise((object)dWebBrowserEvents_SinkHelper, out dwCookie);
				dWebBrowserEvents_SinkHelper.m_dwCookie = dwCookie;
				dWebBrowserEvents_SinkHelper.m_WindowResizeDelegate = windowResizeDelegate;
				this.m_aEventSinkHelpers.Add((object)dWebBrowserEvents_SinkHelper);
			}
			finally
			{
				Monitor.Exit(this);
			}
		}
		public override void remove_WindowResize(DWebBrowserEvents_WindowResizeEventHandler dWebBrowserEvents_WindowResizeEventHandler)
		{
			Monitor.Enter(this);
			try
			{
				if (this.m_aEventSinkHelpers != null)
				{
					int count = this.m_aEventSinkHelpers.Count;
					int num = 0;
					if (0 < count)
					{
						DWebBrowserEvents_SinkHelper dWebBrowserEvents_SinkHelper;
						while (true)
						{
							dWebBrowserEvents_SinkHelper = (DWebBrowserEvents_SinkHelper)this.m_aEventSinkHelpers[num];
							if (dWebBrowserEvents_SinkHelper.m_WindowResizeDelegate != null && ((dWebBrowserEvents_SinkHelper.m_WindowResizeDelegate.Equals((object)dWebBrowserEvents_WindowResizeEventHandler) ? 1 : 0) & 255) != 0)
							{
								break;
							}
							num++;
							if (num >= count)
							{
								goto IL_E1;
							}
						}
						this.m_aEventSinkHelpers.RemoveAt(num);
						this.m_ConnectionPoint.Unadvise(dWebBrowserEvents_SinkHelper.m_dwCookie);
						if (count <= 1)
						{
							Marshal.ReleaseComObject(this.m_ConnectionPoint);
							this.m_ConnectionPoint = null;
							this.m_aEventSinkHelpers = null;
						}
					}
				}
				IL_E1:;
			}
			finally
			{
				Monitor.Exit(this);
			}
		}
		public override void add_WindowActivate(DWebBrowserEvents_WindowActivateEventHandler windowActivateDelegate)
		{
			Monitor.Enter(this);
			try
			{
				if (this.m_ConnectionPoint == null)
				{
					this.Init();
				}
				DWebBrowserEvents_SinkHelper dWebBrowserEvents_SinkHelper = new DWebBrowserEvents_SinkHelper();
				int dwCookie = 0;
				this.m_ConnectionPoint.Advise((object)dWebBrowserEvents_SinkHelper, out dwCookie);
				dWebBrowserEvents_SinkHelper.m_dwCookie = dwCookie;
				dWebBrowserEvents_SinkHelper.m_WindowActivateDelegate = windowActivateDelegate;
				this.m_aEventSinkHelpers.Add((object)dWebBrowserEvents_SinkHelper);
			}
			finally
			{
				Monitor.Exit(this);
			}
		}
		public override void remove_WindowActivate(DWebBrowserEvents_WindowActivateEventHandler dWebBrowserEvents_WindowActivateEventHandler)
		{
			Monitor.Enter(this);
			try
			{
				if (this.m_aEventSinkHelpers != null)
				{
					int count = this.m_aEventSinkHelpers.Count;
					int num = 0;
					if (0 < count)
					{
						DWebBrowserEvents_SinkHelper dWebBrowserEvents_SinkHelper;
						while (true)
						{
							dWebBrowserEvents_SinkHelper = (DWebBrowserEvents_SinkHelper)this.m_aEventSinkHelpers[num];
							if (dWebBrowserEvents_SinkHelper.m_WindowActivateDelegate != null && ((dWebBrowserEvents_SinkHelper.m_WindowActivateDelegate.Equals((object)dWebBrowserEvents_WindowActivateEventHandler) ? 1 : 0) & 255) != 0)
							{
								break;
							}
							num++;
							if (num >= count)
							{
								goto IL_E1;
							}
						}
						this.m_aEventSinkHelpers.RemoveAt(num);
						this.m_ConnectionPoint.Unadvise(dWebBrowserEvents_SinkHelper.m_dwCookie);
						if (count <= 1)
						{
							Marshal.ReleaseComObject(this.m_ConnectionPoint);
							this.m_ConnectionPoint = null;
							this.m_aEventSinkHelpers = null;
						}
					}
				}
				IL_E1:;
			}
			finally
			{
				Monitor.Exit(this);
			}
		}
		public override void add_PropertyChange(DWebBrowserEvents_PropertyChangeEventHandler propertyChangeDelegate)
		{
			Monitor.Enter(this);
			try
			{
				if (this.m_ConnectionPoint == null)
				{
					this.Init();
				}
				DWebBrowserEvents_SinkHelper dWebBrowserEvents_SinkHelper = new DWebBrowserEvents_SinkHelper();
				int dwCookie = 0;
				this.m_ConnectionPoint.Advise((object)dWebBrowserEvents_SinkHelper, out dwCookie);
				dWebBrowserEvents_SinkHelper.m_dwCookie = dwCookie;
				dWebBrowserEvents_SinkHelper.m_PropertyChangeDelegate = propertyChangeDelegate;
				this.m_aEventSinkHelpers.Add((object)dWebBrowserEvents_SinkHelper);
			}
			finally
			{
				Monitor.Exit(this);
			}
		}
		public override void remove_PropertyChange(DWebBrowserEvents_PropertyChangeEventHandler dWebBrowserEvents_PropertyChangeEventHandler)
		{
			Monitor.Enter(this);
			try
			{
				if (this.m_aEventSinkHelpers != null)
				{
					int count = this.m_aEventSinkHelpers.Count;
					int num = 0;
					if (0 < count)
					{
						DWebBrowserEvents_SinkHelper dWebBrowserEvents_SinkHelper;
						while (true)
						{
							dWebBrowserEvents_SinkHelper = (DWebBrowserEvents_SinkHelper)this.m_aEventSinkHelpers[num];
							if (dWebBrowserEvents_SinkHelper.m_PropertyChangeDelegate != null && ((dWebBrowserEvents_SinkHelper.m_PropertyChangeDelegate.Equals((object)dWebBrowserEvents_PropertyChangeEventHandler) ? 1 : 0) & 255) != 0)
							{
								break;
							}
							num++;
							if (num >= count)
							{
								goto IL_E1;
							}
						}
						this.m_aEventSinkHelpers.RemoveAt(num);
						this.m_ConnectionPoint.Unadvise(dWebBrowserEvents_SinkHelper.m_dwCookie);
						if (count <= 1)
						{
							Marshal.ReleaseComObject(this.m_ConnectionPoint);
							this.m_ConnectionPoint = null;
							this.m_aEventSinkHelpers = null;
						}
					}
				}
				IL_E1:;
			}
			finally
			{
				Monitor.Exit(this);
			}
		}
		public DWebBrowserEvents_EventProvider(object obj)
		{
			this.m_ConnectionPointContainer = (IConnectionPointContainer)obj;
		}
		public override void Finalize()
		{
			Monitor.Enter(this);
			try
			{
				if (this.m_ConnectionPoint != null)
				{
					int count = this.m_aEventSinkHelpers.Count;
					int num = 0;
					if (0 < count)
					{
						do
						{
							DWebBrowserEvents_SinkHelper dWebBrowserEvents_SinkHelper = (DWebBrowserEvents_SinkHelper)this.m_aEventSinkHelpers[num];
							this.m_ConnectionPoint.Unadvise(dWebBrowserEvents_SinkHelper.m_dwCookie);
							num++;
						}
						while (num < count);
					}
					Marshal.ReleaseComObject(this.m_ConnectionPoint);
				}
			}
			catch (Exception)
			{
			}
			finally
			{
				Monitor.Exit(this);
			}
		}
		public override void Dispose()
		{
			this.Finalize();
			GC.SuppressFinalize(this);
		}
	}
}
